#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,m,k;
int main(void){
    scanf("%lld%lld%lld",&n,&m,&k);
    if(k>n+m-2){
        printf("-1\n");
    }else if(k==n+m-2){
        printf("1\n");
    }else{
        ll ans=0;
        if(k<=m-1){
            ans=max(ans,n*(m/(k+1)));
        }else{
            ans=max(ans,n/(k-(m-1)+1));
        }
        if(k<=n-1){
            ans=max(ans,m*(n/(k+1)));
        }else{
            ans=max(ans,m/(k-(n-1)+1));
        }
        printf("%lld\n",ans);
    }
    return 0;
}